package com.wcx.application.service.Impl;

import com.wcx.application.domian.ChatList;
import com.wcx.application.domian.ChatMessage;
import com.wcx.application.mapper.ChatMapper;
import com.wcx.application.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChatServiceImpl implements ChatService {
    @Autowired
    ChatMapper chatMapper;

    @Override
    public String selectAssociation(String fromUser, String toUser) {
        return null;
    }

    @Override
    public Integer isFirstChat(String fromUser, String toUser) {
       return chatMapper.isFirstChat(fromUser, toUser);
    }

    @Override
    public void saveMessage(ChatMessage chatMessage) {

    }

    @Override
    public void InitList(ChatList chatList) {
        chatMapper.InitList(chatList);
    }

    @Override
    public void InitMessage(ChatMessage chatMessage) {
        chatMapper.InitMessage(chatMessage);
    }

    @Override
    public void updateLast(Boolean latest) {
        chatMapper.updateLast(latest);
    }

    @Override
    public List<ChatList> getList(String fromId) {
        return chatMapper.getList(fromId);
    }

    @Override
    public List<ChatMessage> getMessage(String fromId, String toId) {
        return chatMapper.getMessage(fromId,toId);
    }

    @Override
    public List<ChatMessage> ChatMessageSearch(String fromId) {
        return chatMapper.ChatMessageSearch(fromId);
    }

    @Override
    public List<ChatMessage> getChatMessagejianl(String fromId) {
        return chatMapper.getChatMessagejianl(fromId);
    }

}
